import confirmsComponent from '../../components/plugs/confirm.vue'
let $vm, confirms = {};
confirms.install = function(Vue, options) {
    if (!$vm) {
        const confirmsPlugin = Vue.extend(confirmsComponent);

        $vm = new confirmsPlugin({
            el: document.createElement('div')
        });

        document.body.appendChild($vm.$el);

    }

    $vm.show = false;

    let confirms = {
        show(options) {
            $vm.show = true;
            $vm = Object.assign($vm, options)
        },
        hide() {
            $vm.show = false;
        }
    };

    if (!Vue.$confirms) {
        Vue.$confirms = confirms;
    }

    Vue.prototype.$confirms = Vue.$confirms;

    // Vue.mixin({
    //     created() {
    //         this.$loading = Vue.$loading;
    //     }
    // })
}
export default confirms